feat(core): Emit sentry.sdk.integrations on streamed segment spans#20428
Conversation
size-limit report 📦
|
db34ebc to
ffe7af4
Compare
b03ea96 to
d394c8e
Compare
…eaming In the classic (non-streaming) pipeline, SDK integrations ride on the transaction event wrapper via `event.sdk.integrations`. The span streaming pipeline emits segment spans directly as span envelope items with no transaction wrapper, so that metadata never reaches ingest. Add `sentry.sdk.integrations` as a native array attribute on segment spans (matching the wire contract Relay expects: `type: 'array'`). Relies on the homogeneous-primitive-array serializer support. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ations Segment spans now ship a sentry.sdk.integrations attribute listing the active SDK integrations. Add the attribute to the full-shape assertions in the browser unit test, the browser/node/cloudflare streamed integration tests, and the Deno e2e test. Matching uses expect.arrayContaining against the explicit integrations configured in each scenario, to stay resilient to default-integration churn. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oxfmt wants the SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS entries broken across multiple lines because they exceed the max line length. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… expectation Same fix applied to node-integration-tests earlier — the node-core-integration-tests streamed basic-usage scenario also needs sentry.sdk.integrations in its full-shape assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d394c8e to
b8aa456
Compare
sentry.sdk.integrations on streamed segment spans
| } | ||
|
|
||
| function applySdkMetadataToSegmentSpan(segmentSpanJSON: StreamedSpanJSON, client: Client): void { | ||
| const integrationNames = client.getOptions().integrations.map(i => i.name); |
There was a problem hiding this comment.
m: Do we need to call this on every capture? We could cache it maybe once?
There was a problem hiding this comment.
yep true that should work, changed it
| function applySdkMetadataToSegmentSpan(segmentSpanJSON: StreamedSpanJSON, client: Client): void { | ||
| let integrationNames = integrationNamesCache.get(client); | ||
| if (!integrationNames) { | ||
| integrationNames = client.getOptions().integrations.map(i => i.name); |
There was a problem hiding this comment.
q: Is the order important here? E.g. if one has "InboundFilters", "BrowserTracing" and another has "BrowserTracing", "InboundFilters". Also should duplicates be removed (not that it happens, but you never know)?
There was a problem hiding this comment.
I don't think it matters. This is also now directly aligned with how this has been implemented in the transaction path for the past 3 years so I'd assume we would have heard about this by now if it would be an issue
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 585ce8c. Configure here.
…ns is populated Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

In the classic (non-streaming) pipeline, SDK integrations are sets on the transaction event wrapper via
event.sdk.integrations. In the streaming path this metadata is currently missing. This PR setssentry.sdk.integrationson streamed segment spans.